<?

/*
*
*   Excalibur Content Management System
*   Copyright © 2008 Egor "Sontan" Kuryanovich
*
*   Based on Explay Engine v2.0 by Golovdinov Alexander
*
*   Official site: www.excms.ru
*   Contact e-mail: support@excms.ru
*
*   GNU General Public License original source:
*   http://www.gnu.org/licenses/gpl-3.0.html
*
*/

if (!isset($_SESSION['just_visit'])
	&& strpos($_SERVER['HTTP_USER_AGENT'], "StackRambler") === false
	&& strpos($_SERVER['HTTP_USER_AGENT'], "Googlebot") === false
	&& strpos($_SERVER['HTTP_USER_AGENT'], "Mediapartners-Google") === false
	&& strpos($_SERVER['HTTP_USER_AGENT'], "Yandex") === false
	&& strpos($_SERVER['HTTP_USER_AGENT'], "Aport") === false
	&& strpos($_SERVER['HTTP_USER_AGENT'], "msnbot") === false
	&& strpos($_SERVER['HTTP_USER_AGENT'], "Yahoo") === false
	&& strpos($_SERVER['HTTP_USER_AGENT'], "robot") === false) {
	
	$db->query ("INSERT INTO ".DB_PEREFIX."_statistics VALUES (0, '$ip', '".$_SERVER['HTTP_USER_AGENT']."', '".$_SERVER['HTTP_REFERER']."', '".$_SERVER['REQUEST_URI']."', ".time().", '$ugroup')");
	
	//$today = time() - ( intval(date(H))*3600 + intval(date(i)*60) );
	$_SESSION['just_visit'] = 1;
}

?>
